const requireDirectory = require('require-directory');
const routers = requireDirectory(module, './');
const jwt = require('koa-jwt');
const {jwt: {SECRET}} = require('../../config/config.json');
module.exports = async (app) => {
    Object.values(routers).forEach(router => {
        // 添加 jwt 验证
        router.use(jwt(SECRET));
        app.use(router.routes())
        .use(router.allowedMethods());
    })
    // next();
}